home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / mint / lib / mntlib44.zoo / mntlib / strlen.c < prev    next >
C/C++ Source or Header  |  1992-09-17  |  321b  |  19 lines

  1. /* from Henry Spencer's stringlib */
  2. #include <string.h>
  3. #undef strlen
  4.  
  5. /*
  6.  * strlen - length of string (not including NUL)
  7.  */
  8. size_t
  9. strlen(scan)
  10. register const char *scan;
  11. {
  12.     register const char *start = scan+1;
  13.  
  14.     if (!scan) return 0;
  15.     while (*scan++ != '\0')
  16.         continue;
  17.     return (size_t)((long)scan - (long)start);
  18. }
  19.